<template>
  <a-row :gutter="16">
    <Left v-bind="attrs" :tableCollection="tableCollection" :mitt="ev" />
    <Right v-bind="attrs" :tableCollection="tableCollection" :mitt="ev" />
  </a-row>
</template>

<script lang="ts" setup>
import mitt from 'mitt';
import { OptionCondition } from '../type';
import Left from './Left.vue';
import Right from './right/index.vue';
import OptionTable from './table';

const props = defineProps<{
  data: OptionCondition;
}>();

if (!props.data.options) {
  props.data.options = [];
}
const tableCollection = computed(() => new OptionTable(props.data));
const attrs = useAttrs() as any;

const ev = mitt();
onBeforeUnmount(() => {
  ev.all.clear();
});
// window._tb = tableCollection.value;
</script>
